package main

import (
	"net/http"
	"github.com/labstack/echo"
	// "github.com/labstack/echo/middleware"
	"github.com/prometheus/client_golang/prometheus/promhttp"
	ewa "gitee.com/jinquan711/ewa"
	//cb "gitee.com/jinquan711/ewa/FILE_NonCookieTokenGet/cb"
)

func accessible(c echo.Context) error {
	return c.String(http.StatusOK, "OK")
}

func main() {

	ewa.ConfigParser()
	//ewa.ConfigPrint()

	e := echo.New()
	// e.Use(middleware.Logger())

	// Mapping resource files to Http-Route
  	ewa.HttpRoute_Mapping_StaticResource(e)


	// Healthy Probe
	e.GET("/healthy", accessible)

	// Prometheus default metrics
	e.GET("/metrics", echo.WrapHandler(promhttp.Handler()) )

	// e.Logger.Fatal(e.Start(ewa.EchoPort))
	e.Start(ewa.EchoPort)
}
